<?php 

$str ="456bc4a";

$preg = "/^[abc456]+$/i";

$c = preg_match($preg, $str);

var_dump($c);

$str ="345.44";

$str = "<a href='http://www.baidu.com'>百度</a><a href='http://www.163.com'>163</a><a href='http://www.qq.com'>腾讯</a>";

$preg = "/href=\'(.+?)\'>/";
// $preg = "/^-?[46]+\.\d+$/";
// $preg = "/^-?\d+$/";
// $preg = "/^(-\d+|\d+)$/";

// $c = preg_match($preg, $str);

// $c = preg_match_all($preg, $str, $out);

// var_dump($c,$out);

$ip ="0.0.0.0";

$preg = "/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2([0-4][0-9]|5[0-5]))\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2([0-4][0-9]|5[0-5]))$/";

$c = preg_match($preg, $ip);

// var_dump($c);


$id = "44528120171131187X";

$preg = "/^[1-5][1-7]\d{4}(19\d{2}|20(0\d|1[0-7]))(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}[0-9X]$/";


$c = preg_match($preg, $id);

var_dump($c);

















 ?>